package com.again.OOM;

import java.util.ArrayList;
import java.util.List;

/**
 * VM Args：-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError
 * -XX:+PrintGCDetails 打印gc详情
 * -XX:+PrintGCDetails -Xloggc:d:\gc.log  将gc详情输出到日志
 * 
 * -Xms20m -Xmx20m -XX:+PrintGCDetails
 */
public class HeapOOM {

	static class OOMObject {
	}

	public static void main(String[] args) {
		List<OOMObject> list = new ArrayList<OOMObject>();

		while (true) {
			list.add(new OOMObject());
		}
	}
}


